﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/fmw/fmwMaster.Master" CodeBehind="songs.aspx.vb" Inherits="SendSMS.songs" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cp2" runat="server">
<div class="filters group">
            <ul class="group">
                <li><a href="#" id="allFilter" onclick="return doFilter('0');">All</a> </li>
                <li><a id="titleFilter" href="#" onclick="return doFilter('1');">Song Title</a></li><li>
                    <a id="albumFilter" href="#" onclick="return doFilter('2');">Album Title</a></li>
            </ul>
        </div>
        <div class='search-box'>
            <form id="frmSearch" action="songs.aspx" method="get">
            <div>
        
            <table cellspacing="0" cellpadding="0" width="100%" style="padding:0px; margin:0px" >
    <tr>
        <td>        
        <input type="text" name="q" id='txtSearch' value='<%= Request.QueryString("q") %>' />
        
        </td>
        <td style="width:32px;"  >
            <input id="btnSearch" type="submit" />
        <%--<img id="imgSearch" src="../images/header-search_btn.png" />--%>
        <%--<input id="btnSearch" type="submit" value="fas" />--%>
        <%--<input type="image" id="btnSearch" />--%>
        <%--<span><img width="15" height="20" style="padding:0px;margin:0px;outline:0px" src="../images/header-search_btn.png" /></span>--%>
        <%--<input  type="image" src="../images/header-search_btn.png" />--%>
        </td>
    </tr>
</table>


                
                
                <input type="hidden" name="p" id="pg" value="0" />
                <input type="hidden" name="f" id="filter" value='<%= Request.QueryString("f") %>' />
                <%--<a id="search_go" href="#" class="mcmsSearch">Go</a>--%>
                <%--<button type="submit" class="btn-default" >search</button>--%>
            </div>
            </form>
        </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cp1" runat="server">
 <div class="list-header">
            <h1>
                <asp:Literal ID="ltlHeader" runat="server"></asp:Literal></h1>
        </div>
        <div>
            <asp:Literal ID="ltl1" runat="server"></asp:Literal>
            <asp:Repeater ID="rptSongs" EnableViewState="false" runat="server">
                <ItemTemplate>
                    <div class="story-item group">
                    <div class="story-item-content">
                    <a target="_blank" href='download.ashx?id=<%#  Eval("ID") %>' class="digg-button">
                        <%--<span class="count">78</span>
                        <span class="digg-it"></span>--%>
                    </a>

                        <a target="_blank" href='s.aspx?id=<%#  Eval("ID") %>'>
                            <h3 title='<%#Eval("Title") %>' class="story-item-title">
                                <%#Eval("DisplayTitle") %></h3>
                            <p class="story-item-description">
                                <%--<span class="story-item-source">fmw11.com</span>                --%>
                                <span class="story-item-teaser">
                                    <%# Eval("DirPath")%></span>
                            </p>
                        </a></div>
                    </div>
                </ItemTemplate>
            </asp:Repeater>
            
            <div class="pager-div">
            <button id="btnPrevious" class="btn float-left" onclick="return pagePrevious()">
                Previous</button>
            
            <button id="btnNext" class="btn float-right" onclick="return pageNext()">
                Next</button>
                </div>
                <br /><br />
        </div>
        <script type="text/javascript">
    var currentPage = parseInt('<%= Request.QueryString("p") %>');
    var totalRecords = parseInt('<%= Me.TotalRecords %>');
    var pageSize = parseInt('<%= Me.PageSize %>');
    var totalPages = Math.floor(totalRecords / pageSize);
    function doPaging() {
        if (currentPage == totalPages) {
            document.getElementById("btnNext").style.display = "none";
        }
        if (currentPage == 0) {
            document.getElementById("btnPrevious").style.display = "none";
        }
    }
    function pageNext() {
        document.getElementById("pg").value = parseInt(currentPage) + 1;
        document.getElementById("frmSearch").submit();
        return false;
    }
    function pagePrevious() {
        document.getElementById("pg").value = parseInt(currentPage) - 1;
        document.getElementById("frmSearch").submit();
        return false;
    }

    function doFilter(f) {
        document.getElementById("filter").value = f;
        document.getElementById("frmSearch").submit();
        return false;
    }

    doPaging();

    var previousFilter = '<%= Request.QueryString("f") %>';
    switch (previousFilter) {
        case '1':
            document.getElementById("titleFilter").className = 'active';
            break;
        case '2':
            document.getElementById("albumFilter").className = 'active';
            break;
        default:
            document.getElementById("allFilter").className = 'active';
            break;
    }


    </script>
</asp:Content>
